//package com.nuoniu.sibanyun.config;
//
//import com.fasterxml.jackson.databind.JsonSerializer;
//import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
//import org.springframework.boot.autoconfigure.jackson.Jackson2ObjectMapperBuilderCustomizer;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import java.time.LocalDateTime;
//import java.time.format.DateTimeFormatter;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @ClassName LocalDateTimeSerializerConfig
// * @Description TODO
// * @Authpr baiqiang
// * @Date 2020/5/26 15:10
// **/
//@Configuration
//public class LocalDateTimeSerializerConfig {
//    @org.springframework.beans.factory.annotation.Value("${spring.jackson.date-format:yyyy-MM-dd HH:mm}")
//    private String pattern;
//
//    @Bean
//    public LocalDateTimeSerializer localDateTimeDeserializer() {
//        return new LocalDateTimeSerializer(DateTimeFormatter.ofPattern(pattern));
//    }
//
//    @Bean
//    public Jackson2ObjectMapperBuilderCustomizer jackson2ObjectMapperBuilderCustomizer() {
//        Map<Class<?>, JsonSerializer<?>> serializers = new HashMap<>(2);
//        serializers.put(LocalDateTime.class,localDateTimeDeserializer());
//        return builder -> builder.serializersByType(serializers);
//    }
//}
